- temporary tables are closed
- current alias is restored
- improved cleanup